public class Main {

    public static void main(String[] args) {
        Book b1 = new Book("1");
        Book b2 = new Book("2");
        Book b3 = new Book("3");
        Book b4 = new Book("4");
        Book b5 = new Book("5");

        BookShelf bookShelf = new BookShelf();
        bookShelf.appendBook(b1);
        bookShelf.appendBook(b2);
        bookShelf.appendBook(b3);
        bookShelf.appendBook(b4);
        bookShelf.appendBook(b5);

        Iterator iterator = bookShelf.iterator();
        while (iterator.hasNext()){
            Book book = (Book) iterator.next();
            System.out.println(book.getName());
        }
    }
}
